<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../public/layui/css/layui.css">
		<link rel="stylesheet" href="../../public/validform/css/style.css">
		<script type="text/javascript" src="../../public/jquery/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="../../public/artDialog/jquery.artDialog.js?skin=blue"></script>
		<script type="text/javascript" src="../../public/artDialog/plugins/iframeTools.js"></script>
		<script type="text/javascript" src="../../public/validform/Validform_v5.3.2_min.js"></script>
	</head>

	<body>
		<div class="layui-fluid">
			<div class="layui-row" style="margin-bottom: 10px;">
				<span class="layui-breadcrumb">
				  <a href="">系统配置</a>
				  <a href=""><cite>用户管理</cite></a>
				</span>
			</div>

			<form class="layui-form registerform" action="">
				<div class="layui-form-item">
					<label class="layui-form-label">用户名</label>
					<div class="layui-input-block">
						<!--
							{
							"info":"数据提交成功！",
							"status":"y"
							 }
						-->
						<input type="text" name="username" datatype="*" ajaxurl="demo/valid.php" nullmsg="用户名不能为空！" errormsg="用户名已经存在！" placeholder="请输入用户名" class="layui-input">
						 <div class="Validform_checktip"></div>
					</div>
				</div>
			
				<div class="layui-form-item">
					<label class="layui-form-label">密码</label>
					<div class="layui-input-block">
						<input type="password" name="username"  datatype="*"  nullmsg="密码不能为空！"   placeholder="请输入密码" class="layui-input">
						<div class="Validform_checktip"></div>
					</div>
				</div>

			
				<div class="layui-form-item" pane="">
					<label class="layui-form-label">角色</label>
					<div class="layui-input-block">
						<input type="checkbox" name="role[1]" lay-skin="primary" title="管理员" checked="">
						<input type="checkbox" name="role[2]" lay-skin="primary" title="编辑人员">
						<div class="Validform_checktip"></div>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<input type="radio" name="status" value="1" title="启动" checked="">
						<input type="radio" name="status" value="0" title="禁止" >
						<div class="Validform_checktip"></div>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">备注</label>
					<div class="layui-input-block">
						<textarea placeholder="请输入内容" class="layui-textarea"></textarea>
					</div>
				</div>
	
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn layui-btn-normal" id="btn_sub" lay-submit="" lay-filter="demo1">立即提交</button>
						<button type="button" onclick="closeWin()" class="layui-btn layui-btn-primary">关闭</button>
					</div>
				</div>
			</form>

			
		</div>
		<script src="../../public/layui/layui.all.js"></script>
		<script type="text/javascript">
			//关闭窗口
			function closeWin(){
				art.dialog.close();
			}
			
			$(function(){
				//表单验证，采用异步提交
				$(".registerform").Validform({
					btnSubmit:"#btn_sub", 
					tiptype:function(msg,o,cssctl){
						if(!o.obj.is("form")){//验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
							var objtip=o.obj.siblings(".Validform_checktip");
							cssctl(objtip,o.type);
							objtip.text(msg);
						}
					},
					ajaxPost:true,
					callback:function(data){ //提交到服务器后回调的方法
						//返回数据data是json对象，{"info":"demo info","status":"y"}
						//回调父页面方法
						art.dialog.opener.ajaxLoad();
						//关闭窗口
						art.dialog.close();
					}
				});
			});

		</script>
	</body>

</html>